package com.arpa.wms.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/8/17
 * @Description:
 * 待弃用！！！！已改为使用DeliveryTypeEnum
 */
@Deprecated
public enum BillTypeEnum {
    /**
     * 单据类型
     */
    OUT_SALE(0,"销售出库"),
    OUT_BAOSUN(1,"报损出库"),
    OUT_LINGYONG(2,"领用出库"),
    OUT_LOSS(3,"盘亏出库"),
    PURCHASE(4, "采购退货"),
    OUT_ALLOCATION(5, "调拨退货")

    ;

    BillTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<Integer,BillTypeEnum> ENUM_MAP = new HashMap();

    static{
        BillTypeEnum[] values = BillTypeEnum.values();
        int length = values.length;
        for (int i = 0;i < length;i++){
            BillTypeEnum value = values[i];
            ENUM_MAP.put(value.getCode(),value);
        }

    }


    public static String translate(Integer code){
        for (BillTypeEnum ele : values()) {
            if(ele.getCode().intValue() == code.intValue()) {
                return ele.getDesc();
            }
        }
        return null;
    }

    private final Integer code;

    private final String desc;

    public Integer getCode() {
        return code;
    }


    public String getDesc() {
        return desc;
    }

}
